package base_demo.demo2;

public class Demo {
    public static void main(String[] args) {
        //通过实现Runnable接口创建线程
        //1.创建一个类实现接口
        Myrun mr = new Myrun();
        //2.在执行类中创建线程将Runnable的实现类赋值
        Thread t1 = new Thread(mr);
        t1.setName("一");
        Thread t2 = new Thread(mr);
        t2.setName("十");
        //2.1设置优先级
        t1.setPriority(10);
        t2.setPriority(1);
        //3.调用线程的start启动线程
        t1.start();
        t2.start();


    }
}
